/*
 Navicat Premium Data Transfer

 Source Server         : localhost_3306
 Source Server Type    : MySQL
 Source Server Version : 80028
 Source Host           : localhost:3306
 Source Schema         : sys

 Target Server Type    : MySQL
 Target Server Version : 80028
 File Encoding         : 65001

 Date: 08/06/2023 16:38:15
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for avatar_member
-- ----------------------------
DROP TABLE IF EXISTS `avatar_member`;
CREATE TABLE `avatar_member` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '虚拟人实例id',
  `gmt_create` datetime DEFAULT NULL COMMENT '创建时间',
  `gmt_modified` datetime DEFAULT NULL COMMENT '修改时间',
  `config` varchar(255) DEFAULT NULL COMMENT '全形象配置',
  `status` int DEFAULT NULL COMMENT '状态',
  `uuid` varchar(255) DEFAULT NULL COMMENT '唯一uuid',
  `text_result` varchar(255) DEFAULT NULL COMMENT '文本结果',
  `avatar_result` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '图像结果',
  `env` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '环境',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of avatar_member
-- ----------------------------
BEGIN;
INSERT INTO `avatar_member` (`id`, `gmt_create`, `gmt_modified`, `config`, `status`, `uuid`, `text_result`, `avatar_result`, `env`) VALUES (1, '2023-06-08 11:51:28', '2023-06-08 16:37:34', '', 2, '123980', '我喜欢吃西瓜', 'oss://test-123/123.mp4', 'dev');
INSERT INTO `avatar_member` (`id`, `gmt_create`, `gmt_modified`, `config`, `status`, `uuid`, `text_result`, `avatar_result`, `env`) VALUES (2, '2023-06-10 15:56:09', '2023-06-16 15:56:13', NULL, 0, '1111222333', '我不喜欢吃西瓜', 'oss://123.0/111.mp4', 'dev');
INSERT INTO `avatar_member` (`id`, `gmt_create`, `gmt_modified`, `config`, `status`, `uuid`, `text_result`, `avatar_result`, `env`) VALUES (3, '2023-06-08 16:32:31', '2023-06-08 16:32:31', '{\"avatar\":\"/mnt/go.mp4\",\"video\":\"/mnt/1.mp3\"}', NULL, NULL, NULL, NULL, 'prod');
INSERT INTO `avatar_member` (`id`, `gmt_create`, `gmt_modified`, `config`, `status`, `uuid`, `text_result`, `avatar_result`, `env`) VALUES (4, '2023-06-08 16:37:10', '2023-06-08 16:37:10', '{\"avatar\":\"/mnt/go.mp4\",\"video\":\"/mnt/1.mp3\"}', NULL, NULL, NULL, NULL, 'prod');


-- ----------------------------
-- Table structure for menu
-- ----------------------------
DROP TABLE IF EXISTS `menu`;
CREATE TABLE `menu`  (
                       `id` bigint(20) NOT NULL AUTO_INCREMENT,
                       `parent_id` bigint(20) NULL DEFAULT NULL COMMENT '父级ID',
                       `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
                       `title` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '菜单名称',
                       `level` int(4) NULL DEFAULT NULL COMMENT '菜单级数',
                       `sort` int(4) NULL DEFAULT NULL COMMENT '菜单排序',
                       `name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '前端名称',
                       `icon` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '前端图标',
                       `hidden` int(1) NULL DEFAULT NULL COMMENT '前端隐藏',
                       PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 26 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '后台菜单表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of menu
-- ----------------------------
INSERT INTO `menu` VALUES (21, 0, '2020-02-07 16:29:13', '权限', 0, 0, 'base', 'base', 0);
INSERT INTO `menu` VALUES (22, 21, '2020-02-07 16:29:51', '用户列表', 1, 0, 'admin', 'base-admin', 0);
INSERT INTO `menu` VALUES (23, 21, '2020-02-07 16:30:13', '角色列表', 1, 0, 'role', 'base-role', 0);
INSERT INTO `menu` VALUES (24, 21, '2020-02-07 16:30:53', '菜单列表', 1, 0, 'menu', 'base-menu', 0);
INSERT INTO `menu` VALUES (25, 21, '2020-02-07 16:31:13', '资源列表', 1, 0, 'resource', 'base-resource', 0);

-- ----------------------------
-- Table structure for resource
-- ----------------------------
DROP TABLE IF EXISTS `resource`;
CREATE TABLE `resource`  (
                           `id` bigint(20) NOT NULL AUTO_INCREMENT,
                           `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
                           `name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '资源名称',
                           `url` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '资源URL',
                           `description` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '描述',
                           `category_id` bigint(20) NULL DEFAULT NULL COMMENT '资源分类ID',
                           `thumbnail` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '大图',
                           `image_url` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '缩略图',
                           PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 39 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '后台资源表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of resource
-- ----------------------------
INSERT INTO `resource` VALUES (33, '2023-06-17 06:05:07', '瑶瑶', 'yaoyao', '', 9, 'https://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/icon/github_icon_01.png', NULL);
INSERT INTO `resource` VALUES (34, '2023-06-17 06:05:31', '小爱', 'xiaoai', '', 9, 'https://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/icon/github_icon_01.png', NULL);
INSERT INTO `resource` VALUES (37, '2023-06-17 06:23:00', '瑶瑶', 'yaoyao', '', 11, 'https://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/icon/github_icon_01.png', NULL);
INSERT INTO `resource` VALUES (38, '2023-06-17 06:23:13', '小爱', 'xiaoai', '', 11, 'https://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/icon/github_icon_01.png', NULL);

-- ----------------------------
-- Table structure for resource_category
-- ----------------------------
DROP TABLE IF EXISTS `resource_category`;
CREATE TABLE `resource_category`  (
                                    `id` bigint(20) NOT NULL AUTO_INCREMENT,
                                    `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
                                    `name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '分类名称',
                                    `sort` int(4) NULL DEFAULT NULL COMMENT '排序',
                                    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '资源分类表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of resource_category
-- ----------------------------
INSERT INTO `resource_category` VALUES (9, '2023-06-17 05:28:44', '人物模型', 1);
INSERT INTO `resource_category` VALUES (10, '2023-06-17 05:28:57', '背景', 3);
INSERT INTO `resource_category` VALUES (11, '2023-06-17 05:29:08', '音色', 2);

-- ----------------------------
-- Table structure for role
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role`  (
                       `id` bigint(20) NOT NULL AUTO_INCREMENT,
                       `name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名称',
                       `description` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '描述',
                       `admin_count` int(11) NULL DEFAULT NULL COMMENT '后台用户数量',
                       `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
                       `status` int(1) NULL DEFAULT 1 COMMENT '启用状态：0->禁用；1->启用',
                       `sort` int(11) NULL DEFAULT 0,
                       PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '后台用户角色表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of role
-- ----------------------------
INSERT INTO `role` VALUES (5, '超级管理员', '拥有所有菜单和资源权限', 0, '2020-02-02 15:11:05', 1, 0);
INSERT INTO `role` VALUES (6, '普通用户', '拥有免费角色和音色使用权限', 0, '2023-06-17 05:29:53', 1, 0);

-- ----------------------------
-- Table structure for role_menu_relation
-- ----------------------------
DROP TABLE IF EXISTS `role_menu_relation`;
CREATE TABLE `role_menu_relation`  (
                                     `id` bigint(20) NOT NULL AUTO_INCREMENT,
                                     `role_id` bigint(20) NULL DEFAULT NULL COMMENT '角色ID',
                                     `menu_id` bigint(20) NULL DEFAULT NULL COMMENT '菜单ID',
                                     PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 137 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '后台角色菜单关系表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of role_menu_relation
-- ----------------------------
INSERT INTO `role_menu_relation` VALUES (132, 5, 21);
INSERT INTO `role_menu_relation` VALUES (133, 5, 22);
INSERT INTO `role_menu_relation` VALUES (134, 5, 23);
INSERT INTO `role_menu_relation` VALUES (135, 5, 24);
INSERT INTO `role_menu_relation` VALUES (136, 5, 25);

-- ----------------------------
-- Table structure for role_permission_relation
-- ----------------------------
DROP TABLE IF EXISTS `role_permission_relation`;
CREATE TABLE `role_permission_relation`  (
                                           `id` bigint(20) NOT NULL AUTO_INCREMENT,
                                           `role_id` bigint(20) NULL DEFAULT NULL,
                                           `permission_id` bigint(20) NULL DEFAULT NULL,
                                           PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 18 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '后台用户角色和权限关系表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of role_permission_relation
-- ----------------------------
INSERT INTO `role_permission_relation` VALUES (1, 1, 1);
INSERT INTO `role_permission_relation` VALUES (2, 1, 2);
INSERT INTO `role_permission_relation` VALUES (3, 1, 3);
INSERT INTO `role_permission_relation` VALUES (4, 1, 7);
INSERT INTO `role_permission_relation` VALUES (5, 1, 8);
INSERT INTO `role_permission_relation` VALUES (6, 2, 4);
INSERT INTO `role_permission_relation` VALUES (7, 2, 9);
INSERT INTO `role_permission_relation` VALUES (8, 2, 10);
INSERT INTO `role_permission_relation` VALUES (9, 2, 11);
INSERT INTO `role_permission_relation` VALUES (10, 3, 5);
INSERT INTO `role_permission_relation` VALUES (11, 3, 12);
INSERT INTO `role_permission_relation` VALUES (12, 3, 13);
INSERT INTO `role_permission_relation` VALUES (13, 3, 14);
INSERT INTO `role_permission_relation` VALUES (14, 4, 6);
INSERT INTO `role_permission_relation` VALUES (15, 4, 15);
INSERT INTO `role_permission_relation` VALUES (16, 4, 16);
INSERT INTO `role_permission_relation` VALUES (17, 4, 17);

-- ----------------------------
-- Table structure for role_resource_relation
-- ----------------------------
DROP TABLE IF EXISTS `role_resource_relation`;
CREATE TABLE `role_resource_relation`  (
                                         `id` bigint(20) NOT NULL AUTO_INCREMENT,
                                         `role_id` bigint(20) NULL DEFAULT NULL COMMENT '角色ID',
                                         `resource_id` bigint(20) NULL DEFAULT NULL COMMENT '资源ID',
                                         PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 263 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '后台角色资源关系表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of role_resource_relation
-- ----------------------------
INSERT INTO `role_resource_relation` VALUES (232, 2, 8);
INSERT INTO `role_resource_relation` VALUES (233, 2, 9);
INSERT INTO `role_resource_relation` VALUES (234, 2, 10);
INSERT INTO `role_resource_relation` VALUES (235, 2, 11);
INSERT INTO `role_resource_relation` VALUES (236, 2, 12);
INSERT INTO `role_resource_relation` VALUES (237, 2, 31);
INSERT INTO `role_resource_relation` VALUES (238, 2, 32);
INSERT INTO `role_resource_relation` VALUES (239, 1, 1);
INSERT INTO `role_resource_relation` VALUES (240, 1, 2);
INSERT INTO `role_resource_relation` VALUES (241, 1, 3);
INSERT INTO `role_resource_relation` VALUES (242, 1, 4);
INSERT INTO `role_resource_relation` VALUES (243, 1, 5);
INSERT INTO `role_resource_relation` VALUES (244, 1, 6);
INSERT INTO `role_resource_relation` VALUES (245, 1, 23);
INSERT INTO `role_resource_relation` VALUES (246, 1, 24);
INSERT INTO `role_resource_relation` VALUES (247, 1, 31);
INSERT INTO `role_resource_relation` VALUES (248, 1, 32);
INSERT INTO `role_resource_relation` VALUES (254, 5, 33);
INSERT INTO `role_resource_relation` VALUES (255, 5, 34);
INSERT INTO `role_resource_relation` VALUES (256, 5, 35);
INSERT INTO `role_resource_relation` VALUES (257, 5, 36);
INSERT INTO `role_resource_relation` VALUES (258, 5, 37);
INSERT INTO `role_resource_relation` VALUES (259, 5, 38);
INSERT INTO `role_resource_relation` VALUES (260, 6, 33);
INSERT INTO `role_resource_relation` VALUES (261, 6, 35);
INSERT INTO `role_resource_relation` VALUES (262, 6, 37);

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user`  (
                       `id` bigint(20) NOT NULL AUTO_INCREMENT,
                       `username` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
                       `password` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
                       `icon` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '头像',
                       `email` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '邮箱',
                       `nick_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '昵称',
                       `note` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注信息',
                       `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
                       `login_time` datetime(0) NULL DEFAULT NULL COMMENT '最后登录时间',
                       `status` int(1) NULL DEFAULT 1 COMMENT '帐号启用状态：0->禁用；1->启用',
                       `invitation_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '邀请码',
                       PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '后台用户表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES (3, 'admin', '$2a$10$B2VUVkuuBeQObi5rb8ec7OWKr9XzBlaiTR.Z2IRogzD/W6fyWRw4i', 'https://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/icon/github_icon_01.png', 'admin@163.com', '系统管理员', '系统管理员', '2023-06-15 13:32:47', '2023-06-15 12:45:16', 1, NULL);
INSERT INTO `user` VALUES (4, 'test', '$2a$10$CC9sBKgvp6/jhgIyt4eRI.uqWN5KxCbye4j0zBbNQe9PhpHvAqD8q', NULL, NULL, '测试', NULL, '2023-06-16 08:40:18', NULL, 1, '111');

-- ----------------------------
-- Table structure for user_login_log
-- ----------------------------
DROP TABLE IF EXISTS `user_login_log`;
CREATE TABLE `user_login_log`  (
                                 `id` bigint(20) NOT NULL AUTO_INCREMENT,
                                 `admin_id` bigint(20) NULL DEFAULT NULL,
                                 `create_time` datetime(0) NULL DEFAULT NULL,
                                 `ip` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
                                 `address` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
                                 `user_agent` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '浏览器登录类型',
                                 PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 434 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '后台用户登录日志表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of user_login_log
-- ----------------------------
INSERT INTO `user_login_log` VALUES (423, 3, '2023-06-15 07:47:22', '192.168.0.245', NULL, NULL);
INSERT INTO `user_login_log` VALUES (424, 3, '2023-06-15 07:48:43', '192.168.0.245', NULL, NULL);
INSERT INTO `user_login_log` VALUES (425, 4, '2023-06-16 08:40:22', '192.168.8.121', NULL, NULL);
INSERT INTO `user_login_log` VALUES (426, 3, '2023-06-16 12:24:48', '192.168.8.121', NULL, NULL);
INSERT INTO `user_login_log` VALUES (427, 3, '2023-06-16 12:49:36', '192.168.8.121', NULL, NULL);
INSERT INTO `user_login_log` VALUES (428, 3, '2023-06-16 13:01:45', '192.168.8.121', NULL, NULL);
INSERT INTO `user_login_log` VALUES (429, 3, '2023-06-17 05:21:55', '192.168.8.121', NULL, NULL);
INSERT INTO `user_login_log` VALUES (430, 3, '2023-06-17 05:44:38', '192.168.8.121', NULL, NULL);
INSERT INTO `user_login_log` VALUES (431, 3, '2023-06-17 05:57:38', '192.168.8.121', NULL, NULL);
INSERT INTO `user_login_log` VALUES (432, 3, '2023-06-17 06:02:47', '192.168.8.121', NULL, NULL);
INSERT INTO `user_login_log` VALUES (433, 3, '2023-06-17 06:04:40', '192.168.8.121', NULL, NULL);

-- ----------------------------
-- Table structure for user_permission_relation
-- ----------------------------
DROP TABLE IF EXISTS `user_permission_relation`;
CREATE TABLE `user_permission_relation`  (
                                           `id` bigint(20) NOT NULL AUTO_INCREMENT,
                                           `admin_id` bigint(20) NULL DEFAULT NULL,
                                           `permission_id` bigint(20) NULL DEFAULT NULL,
                                           `type` int(1) NULL DEFAULT NULL,
                                           PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '后台用户和权限关系表(除角色中定义的权限以外的加减权限)' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of user_permission_relation
-- ----------------------------

-- ----------------------------
-- Table structure for user_role_relation
-- ----------------------------
DROP TABLE IF EXISTS `user_role_relation`;
CREATE TABLE `user_role_relation`  (
                                     `id` bigint(20) NOT NULL AUTO_INCREMENT,
                                     `admin_id` bigint(20) NULL DEFAULT NULL,
                                     `role_id` bigint(20) NULL DEFAULT NULL,
                                     PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 32 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '后台用户和角色关系表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of user_role_relation
-- ----------------------------
INSERT INTO `user_role_relation` VALUES (26, 3, 5);
INSERT INTO `user_role_relation` VALUES (27, 6, 1);
INSERT INTO `user_role_relation` VALUES (28, 7, 2);
INSERT INTO `user_role_relation` VALUES (29, 1, 5);
INSERT INTO `user_role_relation` VALUES (30, 4, 5);
INSERT INTO `user_role_relation` VALUES (31, 8, 1);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
